package com.ruoyi.qbms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.qbms.mapper.QbmsBookMapper;
import com.ruoyi.qbms.domain.QbmsBook;
import com.ruoyi.qbms.service.IQbmsBookService;

/**
 * 题库书籍Service业务层处理
 * 
 * @author zouhuu
 * @date 2022-10-16
 */
@Service
public class QbmsBookServiceImpl implements IQbmsBookService 
{
    @Autowired
    private QbmsBookMapper qbmsBookMapper;

    /**
     * 查询题库书籍
     * 
     * @param id 题库书籍主键
     * @return 题库书籍
     */
    @Override
    public QbmsBook selectQbmsBookById(Long id)
    {
        return qbmsBookMapper.selectQbmsBookById(id);
    }

    /**
     * 查询题库书籍列表
     * 
     * @param qbmsBook 题库书籍
     * @return 题库书籍
     */
    @Override
    public List<QbmsBook> selectQbmsBookList(QbmsBook qbmsBook)
    {
        return qbmsBookMapper.selectQbmsBookList(qbmsBook);
    }

    /**
     * 新增题库书籍
     * 
     * @param qbmsBook 题库书籍
     * @return 结果
     */
    @Override
    public int insertQbmsBook(QbmsBook qbmsBook)
    {
        qbmsBook.setCreateTime(DateUtils.getNowDate());
        return qbmsBookMapper.insertQbmsBook(qbmsBook);
    }

    /**
     * 修改题库书籍
     * 
     * @param qbmsBook 题库书籍
     * @return 结果
     */
    @Override
    public int updateQbmsBook(QbmsBook qbmsBook)
    {
        qbmsBook.setUpdateTime(DateUtils.getNowDate());
        return qbmsBookMapper.updateQbmsBook(qbmsBook);
    }

    /**
     * 批量删除题库书籍
     * 
     * @param ids 需要删除的题库书籍主键
     * @return 结果
     */
    @Override
    public int deleteQbmsBookByIds(Long[] ids)
    {
        return qbmsBookMapper.deleteQbmsBookByIds(ids);
    }

    /**
     * 删除题库书籍信息
     * 
     * @param id 题库书籍主键
     * @return 结果
     */
    @Override
    public int deleteQbmsBookById(Long id)
    {
        return qbmsBookMapper.deleteQbmsBookById(id);
    }
}
